package com.example.simple.adapter

import com.chad.library.adapter4.BaseMultiItemAdapter
import com.example.simple.adapter.viewHolder.SimpleOneAdapter
import com.example.simple.adapter.viewHolder.SimpleTwoAdapter
import com.example.simple.entity.SimpleEntity

/**
 * Created on 2023/1/31.
 * @author Joker
 * Des: 多布局
 */

class SimpleMultiAdapter : BaseMultiItemAdapter<SimpleEntity>() {

    init {
        addItemType(SimpleEntity.TYPE_SIMPLE_ONE, SimpleOneAdapter())
            .addItemType(SimpleEntity.TYPE_SIMPLE_TWO, SimpleTwoAdapter())
            .onItemViewType { pos, list -> list[pos].type }
    }
}